<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<md-step label="General" md-complete="$ctrl.parent.steps[0].completed">
  <md-step-body>
    <md-content layout-padding class="gv-creation-general-content gv-creation-content">
      <form name="applicationForm" ng-submit="$ctrl.parent.next()">
        <div class="gv-form">
          <div class="gv-form-content" layout="column">
            <md-input-container class="md-block">
              <label>Name</label>
              <input ng-model="$ctrl.parent.application.name" type="text" name="name" md-maxlength="512" required />
              <div class="hint" ng-if="$ctrl.shouldDisplayHint(applicationForm.name)">Application name</div>
              <div ng-messages="applicationForm.name.$error">
                <div ng-message="required">Application name is required.</div>
                <div ng-message="md-maxlength">The name has to be less than 50 characters long.</div>
              </div>
            </md-input-container>

            <md-input-container class="md-block">
              <label>Description</label>
              <input ng-model="$ctrl.parent.application.description" type="text" name="description" required />
              <div class="hint" ng-if="$ctrl.shouldDisplayHint(applicationForm.description)">
                Provide a description of your application, what it does, ...
              </div>
              <div ng-messages="applicationForm.description.$error">
                <div ng-message="required">Application description is required.</div>
              </div>
            </md-input-container>

            <md-input-container class="md-block">
              <label>Domain</label>
              <input ng-model="$ctrl.parent.application.domain" type="text" name="domain" />
              <div class="hint" ng-if="$ctrl.shouldDisplayHint(applicationForm.domain)">
                The domain your application will use, if relevant.
              </div>
            </md-input-container>
          </div>
        </div>
        <md-step-actions layout="row">
          <div flex>
            <md-button ng-click="$ctrl.parent.previous()">CANCEL</md-button>
          </div>
          <div layout="row" flex layout-align="end top">
            <md-button type="submit" ng-disabled="applicationForm.$invalid">NEXT</md-button>
          </div>
        </md-step-actions>
      </form>
    </md-content>
  </md-step-body>
</md-step>
